home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-07-02 | 1.1 KB | 33 lines | [TEXT/ToyS] |
- property icount : 0 -- this value is what is set when the script is compiled
- -- the property may have any value at all, depending on how many times this script as run
-
- on increment()
- set icount to icount + 1
- end increment
-
- on open names
- -- this is called when files are dropped on this script application
- -- the first parameter (in this case “names”) contains a list of file pathnames
- -- We’ll simply count and display them
- repeat with i in names
- increment()
- display dialog "File #" & icount & " is “" & i & "”" buttons {"OK"} default button "OK"
- end repeat
- end open
-
- on report()
- -- this handler simply displays the count of files dropped
- display dialog (icount as string) & " files have been dropped since I started running." buttons {"OK"} default button "OK"
- end report
-
- on quit
- -- reset the counter and continue quitting
- -- to bypass this, hold the shift key down when quitting
- -- this is useful when you forget the continue or have bugs in your quit handler
- set icount to 0
- continue quit
- end quit
-
- -- this statement is implicitly part of the “run” handler
- -- it will be called if you double click this script application directly
- report()